<template>
	<view class="page">
		<view class="container">
			<view class="box">
				
				<view class="uni-padding-wrap ">
					<view class="uni-common-mt">
						<!-- <image :src="resultList.content" class="png" mode="widthFix" style="width: 100%;"></image> -->
						<view class="html"><rich-text  :nodes="resultList.content.html"></rich-text></view>
						
					</view>
				</view>
				
			</view>
			
		</view>
	</view>
	<!-- <web-view  src=" https://apitest.hrzhizhang.com/admin/article/index"></web-view> -->
	
</template>

<script>
	export default {
		data() {
			return {
				titel:'',
				resultList:[],
				worksList: [],
				scrollHeight:'460px',
			};
		},
		// onReady: function(res) {
		// 	this.videoContext = uni.createVideoContext('myVideo');
		// },
		onLoad(option) {
			let title = option.t;
			this.titel = title;
			let obj = uni.getSystemInfoSync();
			let clientHeight = obj.screenHeight;
			this.scrollHeight = clientHeight-50+'px';
			// console.log(aid)
			this.loadData();
			uni.setNavigationBarTitle({
			    title: title
			});
		},
		methods: {
			/**
			 * 请求静态数据只是为了代码不那么乱
			 * 分次请求未作整合
			 */
			wx_share(){
				wx.showShareMenu();
			},
			async loadData() {
				let param = {title:this.titel};
				
				// let data = await this.$http.post('fiveRisks',{city:'重庆市',wages_before:'10000',wages_real:'6000'});
				let data = await this.$http.post(
					'wx/article_info', //可以直接放链接(将不启用全局定义域名)
					param, 
				);
				this.resultList = data;
				console.log(data);
				
			},
			
			//详情页
			navToDetailPage(item) {
				if(!this.hasLogin){
					uni.navigateTo({
						url: '/pages/public/login'
					})
					return
				}
				// uni.showToast({
				// 	title: `功能开发中...`,
				// 	icon: 'none'
				// })
				// return
				//测试数据没有写id，用title代替
				let id = item.title;
				uni.navigateTo({
					url: `/pages/works/detail?id=${id}`
				})
			},
		},
		
	}
</script>

<style lang="scss">
	
	.page{
		height: 100Vh;
		width: 100vw;
		background: #F6F6F6;
	}
	
	.box{
		margin-bottom: 0px;
		background: #FFFFFF;
	}
	.html{
		padding:15px
	}
	.myCode{
		// position: absolute;
		width: 100%;
		height: 100px;
	}
	.bottom{
		height: 150px;
	}
	.action-btn{
		height: 35px;
		padding: 5px 0;
		margin-top: 5px;
		width: 150px;
		background:#FE7D4C;
		border-radius: 4rem;
		font-size:16px;
		line-height: 28px;
		color:white;
	}
	.pay-row{
		position: fixed;
		bottom: 15px;
		width: 100%;
		z-index:998;
		.price{
			margin-left: 20px;
			color:gray;
			line-height: 50px;
			width: 40%;
		}
	}
	.content{
		height: 100px;
		padding: 0;
		background: #FFFFFF;
		// border: 1px solid #4CA5FE;
		// box-shadow: 0px 3px 6px rgba(76, 165, 254, 0.3);
		opacity: 1;
		border-radius: 10px;
		margin: 5% 15px;
		position: fixed;
		bottom: 40px;
		width: 90%;
	}

</style>
